package com.xzx.shop_front_api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.Column;
import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * 订单实体类
 */
@Component
@Data
@TableName("shop_orders")
public class Order {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String orderSn;
    private int memberId;
    /**
     * 应付金额（原价总金额）
     */
    private Double amount;

    /**
     * 实付金额（实际支付金额，含优惠、运费）
     */
    private Double payAmount;
    /**
     * 优惠金额（优惠券、满减等）
     */
    private Double discountAmount;

    /**
     * 快递公司名称（如：顺丰、京东物流）
     */
    private String shipCompany;

    /**
     * 运费金额
     */
    private Double shipFee;

    /**
     * 创建时间（时间戳转Date）
     */
    private int createdTime;

    /**
     * 支付时间
     */
    private int payTime;

    /**
     * 发货时间
     */
    private int sendTime;

    /**
     * 取消时间
     */
    private int cancelTime;

    /**
     * 关闭时间（订单超时未支付等场景）
     */
    private int closeTime;

    /**
     * 订单状态：
     * 0 - 待支付
     * 1 - 待发货
     * 2 - 已发货
     * 3 - 已完成
     * 4 - 已取消
     * 5 - 售后中
     */
    private int status;

    /**
     * 支付状态：
     * 0 - 未支付
     * 1 - 已支付
     * 2 - 支付失败
     */
    private int payStatus;

    /**
     * 支付方式：
     * 1 - 支付宝
     * 2 - 微信
     * 3 - 银行卡
     */
    private int payType;

    /**
     * 确认收货时间
     */
    private int receiveTime;

    /**
     * 订单备注（用户或商家填写）
     */
    private String mark;

    /**
     * 收货人姓名
     */

    private String receiverName;

    private String receiverPhone;

    private String receiverAddr;

    /**
     * 优惠券信息（如：优惠券ID+名称，用逗号分隔）
     */
    private String couponInfo;

    /**
     * 更新时间
     */
    private int updateTime;

    /**
     * 快递单号（物流跟踪号）
     */
    private String shipNo;

    private String tradeNo;

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public int getMemberId() {
        return memberId;
    }

    public void setMemberId(int memberId) {
        this.memberId = memberId;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Double getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Double payAmount) {
        this.payAmount = payAmount;
    }

    public Double getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(Double discountAmount) {
        this.discountAmount = discountAmount;
    }

    public String getShipCompany() {
        return shipCompany;
    }

    public void setShipCompany(String shipCompany) {
        this.shipCompany = shipCompany;
    }

    public Double getShipFee() {
        return shipFee;
    }

    public void setShipFee(Double shipFee) {
        this.shipFee = shipFee;
    }

    public int getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(int createdTime) {
        this.createdTime = createdTime;
    }

    public int getPayTime() {
        return payTime;
    }

    public void setPayTime(int payTime) {
        this.payTime = payTime;
    }

    public int getSendTime() {
        return sendTime;
    }

    public void setSendTime(int sendTime) {
        this.sendTime = sendTime;
    }

    public int getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(int cancelTime) {
        this.cancelTime = cancelTime;
    }

    public int getCloseTime() {
        return closeTime;
    }

    public void setCloseTime(int closeTime) {
        this.closeTime = closeTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(int payStatus) {
        this.payStatus = payStatus;
    }

    public int getPayType() {
        return payType;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }

    public int getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(int receiveTime) {
        this.receiveTime = receiveTime;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverPhone() {
        return receiverPhone;
    }

    public void setReceiverPhone(String receiverPhone) {
        this.receiverPhone = receiverPhone;
    }

    public String getReceiverAddr() {
        return receiverAddr;
    }

    public void setReceiverAddr(String receiverAddr) {
        this.receiverAddr = receiverAddr;
    }

    public String getCouponInfo() {
        return couponInfo;
    }

    public void setCouponInfo(String couponInfo) {
        this.couponInfo = couponInfo;
    }

    public int getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(int updateTime) {
        this.updateTime = updateTime;
    }

    public String getShipNo() {
        return shipNo;
    }

    public void setShipNo(String shipNo) {
        this.shipNo = shipNo;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", orderSn='" + orderSn + '\'' +
                ", memberId=" + memberId +
                ", amount=" + amount +
                ", payAmount=" + payAmount +
                ", discountAmount=" + discountAmount +
                ", shipCompany='" + shipCompany + '\'' +
                ", shipFee=" + shipFee +
                ", createdTime=" + createdTime +
                ", payTime=" + payTime +
                ", sendTime=" + sendTime +
                ", cancelTime=" + cancelTime +
                ", closeTime=" + closeTime +
                ", status=" + status +
                ", payStatus=" + payStatus +
                ", payType=" + payType +
                ", receiveTime=" + receiveTime +
                ", mark='" + mark + '\'' +
                ", receiverName='" + receiverName + '\'' +
                ", receiverPhone='" + receiverPhone + '\'' +
                ", receiverAddr='" + receiverAddr + '\'' +
                ", couponInfo='" + couponInfo + '\'' +
                ", updateTime=" + updateTime +
                ", shipNo='" + shipNo + '\'' +
                ", tradeNo='" + tradeNo + '\'' +
                '}';
    }
}
